package test.yunpay.com.mvpproject.presenterImpl;

import test.yunpay.com.mvpproject.OnResultComeBack;
import test.yunpay.com.mvpproject.model.IMainNetMethod;
import test.yunpay.com.mvpproject.modelImpl.MainNetMethodImpl;
import test.yunpay.com.mvpproject.presenter.IMainPresenter;
import test.yunpay.com.mvpproject.util.LogUtil;
import test.yunpay.com.mvpproject.view.IMainView;

/**
 * Created by Administrator on 2018/5/4 0004.
 */

public class MainPresenterImpl implements IMainPresenter, OnResultComeBack {
    private IMainView mView;
    private IMainNetMethod mMainNetMethod;

    public MainPresenterImpl(IMainView view) {
        super();
        mView = view;
        mMainNetMethod = new MainNetMethodImpl();
    }

    @Override
    public void showResult() {
        LogUtil.e("MainPresenterImpl--showResult");
        mMainNetMethod.getDetail(this);
    }

    @Override
    public void success() {
        if (mView!=null){
            mView.showToast("success");
        }

    }

    @Override
    public void fail() {

    }

    @Override
    public void onDestroy() {
        if (mView!=null){
            mView=null;
            System.gc();
        }
    }
}
